package com.tiny.work.plane;

public class OvertimeOrderRuler implements IRuler<ArrangePilot> {

    private int overTime;

    private int sleepTime;

    public int getSleepTime() {
        return sleepTime;
    }

    public OvertimeOrderRuler setSleepTime(int sleepTime) {
        this.sleepTime = sleepTime;
        return this;
    }

    public int getOverTime() {
        return overTime;
    }

    public OvertimeOrderRuler setOverTime(int overTime) {
        this.overTime = overTime;
        return this;
    }

    public OvertimeOrderRuler(int overTime) {
        this.overTime = overTime;
    }

    @Override
    public boolean isMatch(ArrangePilot arrangePilot) {
        Pilot pilot = arrangePilot.getPilot();
        if (pilot.getFlightDays() > overTime) {
            return false;
        }
        return true;
    }

    public OvertimeOrderRuler(int overTime, int sleepTime) {
        this.overTime = overTime;
        this.sleepTime = sleepTime;
    }
}
